System and method for network connection detection

ABSTRACT

The present invention provides a system and method that operates in the link layer and detects connection status in a LAN. The system includes a request frame whose source address is an address of a node transmitting the request frame, a reply frame whose destination address is the source address of the request frame, and a first node and a second node within the LAN for processing the request/reply frame. The method includes the first node transmitting a request frame into the LAN, the second node transmitting a reply frame to the first node if receiving the request frame, and the first node checking whether a destination address of the reply frame comprises an address of the first node when receiving the reply frame. If so, the connection between the first and second nodes is in a normal state.

BACKGROUND OF THE INVENTION

[0001] (a). Field of the Invention

[0002] The present invention relates in general to a system and method for network connection detection, and more particularly to a system and method that operate in a link layer to detect connection status of a local area network (LAN) by transceiving control frames.

[0003] (b). Description of the Prior Arts

[0004] For network users, especially network administrators, it is necessary to confirm that network devices operate normally and physical network connection between them is maintained. Loopback test is commonly used to determine whether hardware of network devices, such as network interface card (NIC) or network switch operate normally. The loopback test for the media access control (MAC) layer of the link layer (Layer 2) is performed by configuring registers of the network devices by software drivers and transmitting signals from the Transmitter to the Receiver. However, when detecting whether the connection between a NIC and a hub or Layer 2 switch is maintained, only t he software program (e.g. common used Ping program) is used to send IP packets of the Network layer (Layer 3) to some remote host for connection detection. If no response is received after sending the IP packets, there are several possible causes: network cable or the connected Layer 2 switch may go wrong, one or some 3 outers oft he network are disable to forward packets, the remote host does not power up, etc. However, more information is not offered to determine what is the specific cause for the network disconnection.

[0005] In view of this, the present invention provides a system and method for detecting connection status between two network devices (e.g. a NIC and a Layer 2 switch, or two NICs) within the network by transceiving Layer 2 packets, i.e. request frames and reply frames, thereby facilitating to find the status of network disconnection.

SUMMARY OF THE INVENTION

[0006] The primary object of the present invention is to provide a system that operates in the link layer and detects connection status in a LAN. The system includes a request frame whose source address is an address of a node transmitting the request frame. The system also includes a reply frame whose destination address is the source address of the request frame. The system also includes a first node and a second node that are located in the LAN and capable of processing the request frame and the reply frame.

[0007] Compared to echo request and echo reply messages of ICMP, transceived in Layer 3 and with an operating scope of the Internet, the system applies Layer 2 control frames in the frame of this invention to all network devices, such as the first and second nodes mentioned above, within the same LAN or broadcast domain. Without need of IP addresses, these network devices employ only Layer 2 MAC addresses to transceive the request frame and the reply frame for detecting connection states. When the first or second node receives a request frame of this invention, it would generate the reply frame of this invention to the node transmitting the request frame, thereby confirming that the connection is normal.

[0008] The secondary object of the present invention is to provide a method for network connection detection using the above system. The method includes the first node transmitting a request frame into the physical medium, and the second node transmitting a reply frame to the first node, if receiving the request frame. The method also includes the first node checking whether a destination address of the reply frame comprises an address of the first node when receiving the reply frame. If so, the connection between the first and second nodes is in a normal state. In an embodiment, the checking is performed only when the first node receives the reply frame within a predetermined period of response time after transmitting the request frame. And if the destination address of the reply frame does not comprise the address of the first node, the reply frame is not valid for the fist node and the first node would re-transmit the request frame to repeat the whole process. In this way, it can be confirmed that the cause of no response is that the connection is broken or in other abnormal conditions, such as network congestion.

BRIEF DESCRIPTION OF THE DRAWINGS

[0009]FIG. 1 is a diagram showing a system for network connection detection according to the present invention.

[0010]FIG. 2 is a block diagram of a frame format used in the first embodiment of the system for network connection detection according to the present invention.

[0011]FIG. 3 is a block diagram of a frame format used in the second embodiment of the system for network connection detection according to the present invention.

[0012]FIG. 4 is a flow chart of the method for detecting connection status according to the present invention.

DETAILED DESCRIPTION OF THE PRESENT INVENTION

[0013]FIG. 1 is a diagram showing a system for network connection detection according to the embodiment of the present invention. The system operates in the link layer (Layer 2) to detect connection status within a LAN 10. The system includes a request frame whose source address is an address of a first node 11 transmitting the request frame, and a reply frame whose destination address is the source address of the request frame. The system also includes the first node 11 and a second node 12 that are located in the LAN 10 and capable of forming and analyzing the request frame and the reply frame. Here the “node” refers to a network device used in the LAN 10, such as a NIC or network switch.

[0014] <First Embodiment>

[0015]FIG. 2 is a block diagram of a frame format 20 used in the first embodiment of the present invention. In FIG. 2, the number in the brackets of each field represents the size of the field by bytes. As shown in FIG. 2, the frame format 20 includes below fields:

[0016] Destination address 21: the “address” is referred to the Ethernet MAC address and contains six bytes. If a request frame is transmitted toward a specific node, the destination address 21 of the request frame is filled with the MAC address of the specific node; if the request frame is not transmitted toward a specific node, the destination address 21 is filled with a broadcast address FF:FF:FF:FF:FF:FF. In a reply frame, the destination address 21 is filled with the source address of the request frame received previously.

[0017] Source address 22: the source address 22 of a request/reply frame is filled with the MAC address of the node transmitting the request/reply frame. But when the node is a network switch and is supposed to hide itself or without the MAC address, the source address 22 of the reply frame is filled with FF:FF:FF:FF:FF:FF.

[0018] Identifier 23: filled with a predetermined value to indicate that the frame containing this identifier 23 supports the system for network connection detection.

[0019] Opcode 24: filled with a first/second value to indicate that the frame containing this opcode 24 is a request/reply frame.

[0020] Padding 25: 44 bytes long and containing all zeros. This field is added to form a minimal Ethernet frame (64 bytes).

[0021] Cyclic redundancy check (CRC) 26: used to verify the correctness of the frame.

[0022] Frame type 27: used to indicate the protocol that the frame conforms to.

[0023] According to a node (e.g. the first node 11 or second node 12) transmitting/receiving a request/reply frame, the operation of the first embodiment is described as follows:

[0024] (1) transmitting the request frame: the node forms the request Same in the format 20 of FIG. 2, and sends it into the LAN 10. If the node does not receive a reply frame within a predetermined response time period after sending the request frame, it means that the network is in a disconnected state.

[0025] (2) receiving the request frame: when the node receives the request frame in the format 20, it sends out a reply frame in response. If the node is a switch, the request frame received from a port would not be forwarded to any other ports, and the switch is supposed to reply to the request frame whose destination address 21 is a broadcast address (i.e. FF:FF:FF:FF:FF:FF). In addition, it is configurable about whether the switch replies to the request frame whose destination address 21 is the MAC address of the switch, If the node is a NIC, then it only replies to the request frame whose destination address 21 is the MAC address of the NIC itself.

[0026] Furthermore, for a NIC not supporting the system, it would drop any received request frame, and for a switch not supporting the system, it would consider a received request frame as a Layer 2 broadcast frame and broadcast it to all ports of the switch. Therefore, if there are at least two devices (NIC or switch) that connect to the switch and support the system, the device transmitting the request frame can still receive the reply frame though the switch does not support the system.

[0027] (3) transmitting the reply frame: when the node receives a request frame, it forms a reply frame in the format 20 to send out.

[0028] (4) receiving the reply frame: when the node receives the reply frame, it checks whether the destination address 21 of the reply frame is the MAC address of the node itself. If so and if the node has ever transmitted a request frame within the response time period, then there exists another node supporting the system in the LAN 10, and the physical transmission and reception between these two nodes is normal. The node is considered as receiving a valid reply frame under two situations described below:

[0029] a. the node has transmitted a request frame without Specifying the destination address 21 (i.e. broadcasting) within the response time period, and the destination address 21 of the received reply frame is the MAC address of the node itself.

[0030] b. the node has transmitted a request frame specifying the destination address 21 (i.e. unicasting) within the response time retied, and the destination address 21 and source address 22 of the received reply frame is the MAC address of the node itself and the destination address 21 of the transmitted request frame respectively.

[0031] <Second Embodiment>

[0032] This embodiment uses only broadcast frames and is not capable of specifying specific MAC addresses. FIG. 3 is a block diagram of a frame format 30 used in the second embodiment of the present invention. The format 30 is similar to the format 20, except the opcode field 24 is incorporated into the padding field 25 in the former.

[0033] According to a node (e.g. the first node 11 or second node 12) transmitting/receiving a request/reply frame, the operation of the second embodiment is described as follows:

[0034] (1) transmitting the request frame: the node forms the request frame in the format 30 of FIG. 3, and sends it into the LAN 10. If the node does not receive a reply frame within a predetermined response time period after sending the request frame, it means that the network is in a disconnected state. The node can re-transmit a request frame at this time.

[0035] (2) receiving the request frame: when the node receives the request frame in the format 30, it sends out a reply frame in response. If the node is a switch, the request frame received from a port would not be forwarded to any other ports. A NIC not supporting the system would drop any received request frame, and a switch not supporting the system would consider a received request frame as a Layer 2 broadcast frame and broadcast it to all ports of the switch. Therefore, if there are at least two devices (NIC or switch) that connect to the switch and support the system, the device transmitting the request frame can still receive the reply frame though the switch does not support the system.

[0036] (3) transmitting the reply frame: when the node receives a request frame, it forms a reply frame in the format 30 to send out. A user can determine to enable/disable the feature of transmitting a reply frame automatically.

[0037] (4) receiving the reply frame: when the node receives the reply frame, it checks whether the destination address 21 of the reply frame is the MAC address of the node itself. If so and if the node has ever transmitted a request frame within the response time period, then there exists another node supporting the system in the LAN 10, and the physical transmission and reception between these two nodes is normal.

[0038] Next, it would be explained how to utilize the above system to implement the method for network connection detection according to the present invention. The method is adaptable to the first and second embodiments mentioned above. FIG. 4 is a flow chart of the method for detecting connection status in the LAN 10 according to the present invention. As shown in FIG. 4, the flow chart comprises steps of:

[0039]41 the first node 11 transmitting a request frame into the LAN 10;

[0040]42 the second node 12 checking whether it receives the request frame, if no then jumping to step 44;

[0041]43 the second node 12 transmitting a reply frame to the first node 11;

[0042]44 the first node 11 checking whether it receives a reply frame within a predetermined response time period after transmitting the request frame, if no then jumping to the step 41;

[0043]45 the first node 11 checking whether the destination address 21 of the received reply frame is the MAC address of the first node 11, if no then jumping to the step 44; and

[0044]46 the connection between the first node 11 and the second node 12 being normal.

[0045] In the step 44, if the first node 11 does not receive the reply frame within the response time period, then the flow returns to the step 41 to re-transmit a request frame. By testing network connection repeatedly, it can be confirmed that the cause of no response is that the connection is disable or in other abnormal conditions, such as network congestion.

[0046] The embodiments disclosed in the present invention are the mechanism and method for use in the Ethernet. It should be noted that the present invention is not limited to the Ethernet. The present invention can be used in other network protocols as well.

[0047] While the present invention has been shown and described with reference to two preferred embodiments thereof, and in terms of the illustrative drawings, it should be not considered as limited thereby. Various possible modification, omission, and alterations could be conceived of by one skilled in the art to the form and the content of any particular embodiment, without departing from the scope and the spirit of the present invention. 

What is claimed is:
 1. A system for detecting a connection status in a network, wherein the network comprises at least a first node and a second node, the system comprising: a request frame transmitted by the first node including a source address comprising an address of the first node; and. a reply frame transmitted by the second node after receiving the request frame including a destination address comprising the address of the first node; wherein the first node determines the connection status in a link layer according to the destination address of the reply frame.
 2. The system as recited in claim 1, wherein the first node re-transmits the request frame if not receiving the reply frame within a predetermined response time period.
 3. The system as recited in claim 1, wherein both the destination address of the request frame and the source address of the reply frame comprise an address of the second node.
 4. The system as recited in claim 1, wherein both the destination address of the request frame and the source address of the reply frame comprise a broadcast address.
 5. The system as recited in claim 1, wherein the first node and the second node comprise a network interface card (NIC) or a switch.
 6. The system as recited in claim 5, wherein if the second node comprises the NIC, it transmits the reply frame when the destination address of the received request frame comprises an address of the second node.
 7. The system as recited in claim 5, wherein if the second node comprises the switch, it transmits the reply frame when the destination address of the received request frame comprises a broadcast address.
 8. The system as recited in claim 5, wherein if the second node comprises the switch, it selectively transmits the reply frame when the destination address of the received request frame comprises an address of the second node.
 9. The system as recited in claim 1, wherein both the request and the reply frame comprise an opcode for indicating the request frame and the reply frame respectively.
 10. The system as recited in claim 1, wherein both the request frame and the reply frame comprise an identifier for indicating supporting the system.
 11. The system as recited in claim 1, wherein the network is an Ethernet network.
 12. A method for detecting a connection status in a network, wherein a first node and a second node are connected via the network, the method comprising: transmitting a request frame to the network by the first node; transmitting a reply frame to the network by the second node when the second node receiving the request frame; and determining, by the first node in a link layer, the connection status according to a destination address of the reply frame.
 13. The method as recited in claim 12, wherein the first node determines the connection status through checking whether the destination address of the reply frame comprises the address of the first node when receiving the reply frame within a predetermined response time period after the first node transmits the request frame.
 14. The method as recited in claim 12, wherein the first node re-transmits the request frame if not receiving the reply frame within the predetermined response time period.
 15. The method as recited in claim 12, wherein the first node and the second node comprise a network interface card (NIC) or a switch.
 16. The method as recited in claim 15, wherein if the second node comprises the NIC, it transmits the reply frame when the destination address of the received request frame comprises an address of the second node.
 17. The system as recited in claim 15, wherein if the second node comprises the switch, it transmits the reply frame when the destination address of the received request frame comprises a broadcast address.
 18. The system as recited in claim 15, wherein if the second node comprises the switch, it selectively transmits the reply frame when the destination address of the received request frame comprises an address of the second node.
 19. A system for detecting a connection status in a network, wherein a first node and a second node are connected via the network, the apparatus comprising: a transmitter, in the first node, for transmitting a request frame to the network, wherein a source address of the request frame comprises an address of the first node; and a receiver, in the first node, for receiving a reply frame from the second node, wherein the second node transmits the reply frame according to the request frame; wherein the first node determines the connection status in a link layer according to a destination address of the reply frame from the second node.
 20. The system of claim 19, wherein the first node re-transmits the request frame if not receiving the reply frame within a predetermined response time period. 